import { App, epclass, navigate } from '../../library/api/index'

Page({
  data: {
    navMe: 'on',
  },
  onLoad: function(e) {
    App.jice.onLoad(e)
  },
  onReady: function() {
    App.jice.track('page', {
      pagepath: '/pages/me/index',
      pageTitle: '个人中心-首页',
      pageType: 'view'
    })
    App.logger({
      type: App.G.view,
      channel: App.G.channel,
      target: '个人中心-首页'
    })
  },
  onShow: function() {
    App.jice.track('appshow')
  },
  goEpclass: function(event) {
    App.jice.track('click', event)
    navigate.to('/pages/me/epclass/index')
  },
  goOrder: function(event) {
    App.jice.track('click', event)
    navigate.to('/pages/me/order/index')
  },
  onShareAppMessage: function() {
    return {
      title: '【专家学堂-美赞臣中国】与专家对话，做A+妈妈',
      desc: '听了这些资深专家的话，你也能成为A+妈妈哟~还不快来报名？',
      path: '/pages/me/index',
      success: function() {
        epclass.shareLogger({
          class_id: 0,
          target: '个人中心',
          action: 'appMessage'
        }, r => {
        })
      }
    }
    App.jice.track('onshare', {
      shareto: 'friend',
      title: '【专家学堂-美赞臣中国】与专家对话，做A+妈妈',
      path: '/pages/me/index'
    })
  }
})
